#pragma once
#include <vector>
#include <memory>
#include <string>
#include <iostream>
using namespace std;
struct ResultData {
    double x, y, z, zb, u, v, flag, Total_In;
};

class DatReader {
public:
    DatReader();
    vector<ResultData> load(const string& filePath, const int NCells);

private:
    string path;
    vector<ResultData> resultData;
    unique_ptr<char[]> fileData;
    size_t fileSize;

    void parse(const char* start, const char* end);
    static const char* parseField(const char* p, double& res);
};